package com.itheima.demo6;

public class ThreadDemo2 {
    public static void main(String[] args) {

        //创建一个MyRun对象
        Runnable mr = new MyRun();

        //创建一个Thread对象表示多线程要执行的任务
        Thread thread1 = new Thread(mr);
        Thread thread2 = new Thread(mr);

        thread1.setName("线程一");
        thread2.setName("线程二");

        thread1.start();
        thread2.start();

    }
}
